package bombita.menu;

import java.awt.event.KeyEvent;


import ar.uba.fi.algo3.titiritero.controlador.KeyPressedObservador;

public class ControladorMenu implements KeyPressedObservador
{
	private Menu controlado;
	
	public ControladorMenu (Menu aControlar)
	{
		controlado = aControlar;
	}
	
	@Override
	public void keyPressed(KeyEvent event)
	{
		switch (event.getKeyCode()) {
		case KeyEvent.VK_UP:
		case KeyEvent.VK_LEFT:
			controlado.siguiente();
			break;
		case KeyEvent.VK_DOWN:
		case KeyEvent.VK_RIGHT:
			controlado.anterior();
			break;
		case KeyEvent.VK_SPACE:
		case KeyEvent.VK_ENTER:
			controlado.seleccionar();
			break;
		case KeyEvent.VK_ESCAPE:
			controlado.atras();
		} 
	}
	
	@Override
	public void keyReleased(KeyEvent event)
	{
	}
}
